﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DrugStore.Models.ProductFormViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.product.ProductID) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.product.ProductID) %>
                <%: Html.ValidationMessageFor(model => model.product.ProductID) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.product.ProductName) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.product.ProductName) %>
                <%: Html.ValidationMessageFor(model => model.product.ProductName) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.product.BriefDescription) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.product.BriefDescription) %>
                <%: Html.ValidationMessageFor(model => model.product.BriefDescription) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.product.CurrentPrice) %>
            </div>
            <div>
                
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.product.CurrentPrice, String.Format("{0:F}", Model.product.CurrentPrice))%>
                <%: Html.ValidationMessageFor(model => model.product.CurrentPrice)%>
            </div>
            
            <div class="editor-label">
                <%:Html.LabelFor(m=>m.Categories) %>    
                <%:Html.DropDownListFor(m=>m.Categories,Model.Categories) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.product.CategoryId)%>
                <%: Html.ValidationMessageFor(model => model.product.CategoryId)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.product.DateCreate)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.product.DateCreate, String.Format("{0:g}", Model.product.DateCreate))%>
                <%: Html.ValidationMessageFor(model => model.product.DateCreate)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.product.ImagePath)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.product.ImagePath)%>
                <%: Html.ValidationMessageFor(model => model.product.ImagePath)%>
            </div>                                 
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

